﻿using GameCreator.Core;
using Gp.Scripts.Core;
using Gp.Scripts.Core.Unit;
using Gp.Scripts.Data;
using Sirenix.OdinInspector;

namespace Gp.Scripts.Core
{
    public enum EntityType
    {
        [LabelText("人形实体")]
        Humanoid = 1,
        
        [LabelText("怪物实体")]
        Monster = 2,
        
        [LabelText("场景物件")]
        Prop = 3,
        
        [LabelText("掉落物")]
        DroppedItem = 4,
    }




    public static class UnitEntityFactory
    {
        public static BaseUnit CreateUnit(this Unit.UnitType entityType)
        {
            if (entityType == UnitType.HUMANOID)
                return new HumanoidUnit();
            else return new BasicPropUnit();
        }

        public static BaseUnit CreateUnit(Unit.ConfigUnit configUnit)
        {
            return CreateUnit(configUnit.UnitType);
        }
    }
}